﻿<UserControl x:Class="HomeModule.Index.IndexView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400" HorizontalAlignment="Center" VerticalAlignment="Center">

    <Grid x:Name="LayoutRoot" Background="White" HorizontalAlignment="Center" VerticalAlignment="Center">

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>


        <StackPanel Grid.Row="0" Orientation="Vertical" HorizontalAlignment="Center" Margin="10">

            <HyperlinkButton Margin="5" NavigateUri="/Widgets/WeatherWidget/Country/CzechRepublic/City/Prague" TargetName="WidgetsRegion" Content="Load Czech Republic Weather Widget To Widget Region" HorizontalAlignment="Center"/>
            <HyperlinkButton Margin="5" NavigateUri="/Widgets/WeatherWidget/Country/Serbia/City/Kula" TargetName="WidgetsRegion" Content="Load Serbia Weather Widget To Widget Region" HorizontalAlignment="Center"/>            


        </StackPanel>

        <StackPanel Orientation="Vertical" Grid.Row="1">
            <TextBlock Text="Home Module" FontSize="25" HorizontalAlignment="Center"></TextBlock>
            <TextBlock Text="Index View" FontSize="25" HorizontalAlignment="Center"></TextBlock>
            <Grid Visibility="{Binding WeHaveParameters}" Margin="0,50,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="*"></RowDefinition>                    
                </Grid.RowDefinitions>

                <TextBlock Text="Parameters passed to view:" HorizontalAlignment="Center" Grid.Row="0" />

                <ListBox Grid.Row="1" ItemsSource="{Binding Parameters}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding Key, StringFormat='\{0}\ =>'}" MinWidth="100"  />
                                <TextBlock Text="{Binding Value}" />                            
                        </StackPanel>
                    </DataTemplate>                    
                </ListBox.ItemTemplate>
            </ListBox>
            </Grid>                
        </StackPanel>
    </Grid>
</UserControl>
